import React from 'react';
import { DatePicker } from 'antd';
import moment from 'moment';
import 'antd/lib/date-picker/style'
const { MonthPicker, RangePicker, WeekPicker } = DatePicker;


// <HDateTime start_date end_date onChange>
export default class HDateTime extends React.Component {

  constructor(props) {
    super(props);
  }

  onChange = (date, dateString) => {
    this.props.onChange(dateString);

  }

  render() {
    const dateFormat = 'YYYY-MM-DD';

    return      <RangePicker disabled={this.props.disabled} defaultValue={[moment(this.props.start_date, dateFormat), moment(this.props.end_date, dateFormat)]}  onChange={this.onChange} />
  }

}
